import Event from '../utils/event'

class GameModel {

  constructor() {
     // 当前页面切在哪个场景下
    this.stage = ''
    // stage 改变触发事件
    this.stageChanged = new Event(this)
  }

  getStage() {
    return this.stage
  }

  // 动态触发view变化，告诉controller stage状态改变
  setStage(stage) {
    this.stage = stage
    // 触发时将当前场景传递过去
    this.stageChanged.notify({
      stage: stage
    })
  }

}

export default new GameModel()